package com.xcdh.base.controller;

import com.xcdh.base.service.DeptService;
import com.xcdh.domain.entity.DeptDO;
import com.xcdh.commons.controller.BaseController;
import com.xcdh.domain.vo.ElTree;
import com.xcdh.domain.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController extends BaseController< DeptDO , DeptService>{

    @Autowired
    private DeptService deptService ;


    @PostMapping("/listTree")
    public R<List<ElTree<Long>>> listTree(@RequestBody DeptDO data) {
        return R.okData(deptService.list(data));
    }
}
